import unittest
from genshi.builder import Element, tag
from genshi.core import Attrs, Markup, Stream
from genshi.input import XML

class MyTestCase(unittest.TestCase):

    def test_hello(self):
        link = tag.a(href='#', title='Foo', accesskey=None)('Bar')
        print "hello", link

    def test_markup_escape(self):
        a = Markup('Err $s, %s ') % 'code'
        print a 
        m = Markup('See %s') % tag.a('genshi',
                                     href='http://genshi.edgwall.org')
        print m
        self.assertEqual(m, Markup('See <a href="http://genshi.edgwall.org">'
                                   'genshi</a>'))
        
        
def suite():
    suite = unittest.TestSuite()
    # suite.addTest(doctest.DocTestSuite(Element.__module__))
    suite.addTest(unittest.makeSuite(MyTestCase, 'test'))
    return suite


if __name__ == '__main__':
    unittest.main(defaultTest='suite')
